import request from '@/utils/request'

function add(data) {
  return request({
    url: '/chapter/add',
    method: 'post',
    data
  })
}
function addBatch(data) {
  return request({
    url: '/chapter/addBatch',
    method: 'post',
    data
  })
}
function deletes(data) {
  return request({
    url: '/chapter/delete/' + data,
    method: 'delete',
  })
}

function update(data) {
  return request({
    url: '/chapter/update',
    method: 'put',
    data
  })
}
function info(data) {
  return request({
    url: '/chapter/info/' + data,
    method: 'get',
  })
}
function list(data) {
  return request({
    url: '/chapter/list',
    method: 'get',
    params: data
  })
}
function getChapters(data) {
  return request({
    url: '/course/getChapters',
    method: 'get',
    params: data
  })
}

export default { add,addBatch, deletes, update, info, list,getChapters }